NOTE: This Technical Q&A has been retired. Please see the Technical Q&As page for current documentation.

Technical Q&A PLAT08
Crashes on Quit in MPW 3.4a7


Q: In MPW Shell 3.4a7, in a routine disposeGlobals called during Quit, a disposePtr call is made on a locked handle. This sometimes causes crashes on Quit.

A: This is fixed in MPW Shell 3.4b2. The crashes occurred because the memory for the environment globals was allocated using NewHandleClear, then LockHHi'd, and then the handle was de-referenced and stored as the pointer to the block. At termination time, this pointer was picked up by disposeGlobals and passed to DisposePtr. Since this particular address is already a de-referenced handle, it can cause the crash you experienced.

In MPW Shell 3.4b2, the pointer to the environment globals is the argument to a RecoverHandle call (to retrieve the real handle for the block of memory), which is then passed to DisposeHandle.

[Jun 01 1995]


Developer Documentation | Technical Notes | Development Kits | Sample Code